package design_pattern.state.demo02.state;

import design_pattern.state.demo02.WorkContext;

/**
 * @version 1.0.0
 * Created by cyd on 2022-06-05 16:57:22
 * @ClassName : design_pattern.state.demo02.state.OutOfWorkState
 * @Description : 类描述
 */
public class OutOfWorkState implements State {
    @Override
    public void handleState(WorkContext workContext) {
        float hour = workContext.getHour();
        if (hour < 9 || hour > 18) {
            System.out.println("下班，开心");
        }else {
            workContext.setState(new ForenoonState());
        }
    }
}
